package com.qqtech.qquan.mall.model;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.util.StringUtil;
import com.qqtech.qquan.mall.enums.MallConst;
import com.qqtech.qquan.mall.enums.MallSupplierTypeDictEnum;

@SuppressWarnings("serial")
public class MallSupplierVo extends MallSupplier{
	
	/** 社区名称 */
	public String communityName;
	/** 关联用户**/
	public Integer userId;
	public String userInfo;	

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(String userInfo) {
		this.userInfo = userInfo;
	}

	public String getCommunityName() {
		return communityName;
	}

	public void setCommunityName(String communityName) {
		this.communityName = communityName;
	}

	public String getPathLogo() {
		if (StringUtil.isBlank(this.getLogo())) {
			return "";
		}
		return this.getImgHandleDomain() + this.getLogo() + MallConst.IMG_SUPPLIER_LOGO;
	}
	
	public String getPathBg() {
		if (StringUtil.isBlank(this.getBgImg())) {
			return "";
		}
		return this.getImgHandleDomain() + this.getBgImg() + MallConst.IMG_SUPPLIER_BG;
	}
	
	public String getPathSubjectImg1() {
		if (StringUtil.isBlank(this.getSubjectImg())) {
			return "";
		}
		return this.getFileDomain() + this.getSubjectImg();
	}
	
	public String getPathSubjectImg2() {
		if (StringUtil.isBlank(this.getSubjectImg())) {
			return "";
		}
		return this.getImgHandleDomain() + this.getSubjectImg() + MallConst.IMG_SUPPLIER_SUBJECT1;
	}
	public String getPathSubjectImg3() {
		if (StringUtil.isBlank(this.getSubjectImg())) {
			return "";
		}
		return this.getImgHandleDomain() + this.getSubjectImg() + MallConst.IMG_SUPPLIER_SUBJECT2;
	}
	
	public String getPathFirstImg() {
		if (StringUtil.isBlank(this.getSubjectImg())) {
			return "";
		}
		return this.getImgHandleDomain() + this.getFirstImg() + MallConst.IMG_SUPPLIER_FIRST;
	}
	
	public String getTypeStr() {
		if(this.getType() != null){
			return MallSupplierTypeDictEnum.getDesc(this.getType());
		}
		return "";
	}
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}
	
}